<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->


<title>Quirksome Squares</title>
<meta name="description" content="Quirksome Squares">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<link rel="STYLESHEET" href="acm-00256_archivos/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">
 <h1><br clear="all"><center><table bgcolor="#0060f0"><tbody><tr><td><b><font size="5" color="#c0ffff">&nbsp;<a name="SECTION0001000000000000000000">Quirksome Squares</a></font>&nbsp;</b></td></tr></tbody></table></center></h1>
<p>
The number 3025 has a remarkable quirk: if
you split its decimal representation in two strings
of equal length (30 and 25) and square the
sum of the numbers so obtained, you obtain the
original number:
</p><p>
</p><p> <img alt="displaymath26" src="acm-00256_archivos/256img1.gif" width="316" align="bottom" height="20"> </p><p>
</p><p>
The problem is to determine all numbers with
this property having a given even number of
digits.
</p><p>
</p><p>
For example, 4-digit numbers run
from 0000 to 9999.  Note that leading zeroes should be
taken into account.  This means that 0001
which is equal to  <img alt="tex2html_wrap_inline28" src="acm-00256_archivos/256img2.gif" width="74" align="middle" height="30">  is a quirksome number
of 4 digits.  The number of digits
may be 2,4,6 or 8. Although maxint is only 32767 and
numbers of eight digits are asked for,
a well-versed programmer can keep his numbers in the
range of the integers.  However efficiency should be given a thought.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">Input</a></font></h2>
<p>
The input of your program is a textflle containing
numbers of digits (taken from 2,4,6,8),
each number on a line of its own.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">Output</a></font></h2>
<p>
The output is a textfile consisting of lines containing the
quirksome numbers (ordered according to the
input numbers and for each input number in
increasing order).
</p><p>
</p><p>
</p><p>
<b>Warning:</b>
Please note that the number of digits in
the output is equal to the number in the corresponding
input line : leading zeroes may not be suppressed.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001003000000000000000">Sample Input</a></font></h2>
<p>
</p><pre>2
2</pre>
<p>
</p><h2><font color="#0070e8"><a name="SECTION0001004000000000000000">Sample Output</a></font></h2>
<p>
</p><pre>00
01
81
00
01
81</pre>
<p>
</p></body></html>